package com.capgemini.fs.presentation.user.web.form;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;


public class CreateUserForm extends ActionForm {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String username;
	private String password;
	private String confirmpwd;
	private String firstname;
	private String lastname;
	private String email;
	private String[] role;
	private int active;
    private int status;
    private String category;
	
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	private String phoneno;
	private String[] group;
	public String[] getGroup() {
		return group;
	}
	public void setGroup(String[] group) {
		this.group = group;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getConfirmpwd() {
		return confirmpwd;
	}
	public void setConfirmpwd(String confirmpwd) {
		this.confirmpwd = confirmpwd;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	
	
	public String[] getRole() {
		return role;
	}
	public void setRole(String[] role) {
		this.role = role;
	}
	public int getActive() {
		return active;
	}
	public void setActive(int active) {
		this.active = active;
	}
	public String getPhoneno() {
		return phoneno;
	}
	public void setPhoneno(String phoneno) {
		this.phoneno = phoneno;
	}
	
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		this.role = null;
		this.group = null;
	}
	public void reset(ActionMapping mapping, ServletRequest request) {
		this.role = null;
		this.group = null;
	}
	
/*	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		
		//Create a ActionErrors object
		ActionErrors errors = new ActionErrors();
		
		//add mistake info
		if(this.password==null||this.password.trim().equals("")){
			errors.add("pagePassword", new ActionMessage("err.password"));
		}
		if(this.confirmpwd==null||this.confirmpwd.trim().equals("")){
			errors.add("pageConfirmpwd", new ActionMessage("err.confirmpwd"));	
		}
		if(!this.password.equals(this.confirmpwd)){
			errors.add("comparePassword", new ActionMessage("err.comparePassword"));
		}
		if(this.firstname==null||this.firstname.trim().equals("")){
			errors.add("firstname", new ActionMessage("err.firstname"));
		}
		if(this.lastname==null||this.lastname.trim().equals("")){
			errors.add("lastname", new ActionMessage("err.lastname"));
		}
		if(this.email==null||this.email.trim().equals("")){
			errors.add("email", new ActionMessage("err.email"));
		}
		if(this.role==null||this.role[0].trim().equals("")){
			errors.add("role", new ActionMessage("err.role"));
		}
		
		
		
		return errors;
	}*/
}
